

@RestController
@RequestMapping("/umsPermission")
public class UmsPermissionController {

    @Resource
    private UmsPermissionService umsPermissionService;


    /**
     * 获取 UmsPermission 分页列表
     */
    @GetMapping("/pagination")
    public Ret getUmsPermissionPagination( PaginationVo paginationVo, UmsPermissionQuery umsPermissionQuery ) throws Exception {
        IPage page = umsPermissionService.getUmsPermissionPagination(paginationVo, umsPermissionQuery );
        return Ret.toPage(page);
    }


    /**
     * 获取 UmsPermission 所有数据
     */
    @GetMapping("/all")
    public Ret getUmsPermissionAllList( UmsPermissionQuery umsPermissionQuery ) throws Exception {
        List<UmsPermissionEntity> list = umsPermissionService.getUmsPermissionAllList( umsPermissionQuery );
        return Ret.ok(list);
    }



    /**
     * 获取 UmsPermission 详情
    */
   @GetMapping("/{id}")
   public Ret getUmsPermissionDetail(@PathVariable Long id) throws Exception {

       UmsPermissionEntity umsPermission = umsPermissionService.getUmsPermissionDetail(id);
       return Ret.ok(umsPermission);
   }


    /**
     * 新增 UmsPermission
     * */
    @PostMapping("")
    public Ret addUmsPermission(@RequestBody UmsPermissionVo umsPermissionVo) throws Exception {

        umsPermissionService.addUmsPermission(umsPermissionVo);
        return Ret.ok();
    }


    /**
     * 更新 UmsPermission
     * */
    @PutMapping("")
    public Ret updateUmsPermission(@RequestBody UmsPermissionVo umsPermissionVo) throws Exception {

        umsPermissionService.updateUmsPermission(umsPermissionVo);
        return Ret.ok();
    }


    /**
     * 删除 UmsPermission
     * */
    @PostMapping("/batchRemove")
    public Ret batchRemoveUmsPermission( @RequestBody List<Long> ids ) throws Exception {

        umsPermissionService.batchRemoveUmsPermission(ids);
        return Ret.ok();
    }
}

  